package com.tanhua.model.vo;

import com.tanhua.model.domain.UserInfo;
import com.tanhua.model.mongo.PeachVoice;
import com.tanhua.model.mongo.Visitors;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.bson.types.ObjectId;
import org.springframework.beans.BeanUtils;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

//桃花传音封装类
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PeachVoiceVo implements Serializable {
    private Long id;//用户ID
    private String avatar; //头像
    private String nickname; //昵称
    private String gender;//性别
    private Integer age; //年龄
    private String soundUrl; //语音文件，URL
    private Integer remainingTimes; //剩余次数

    public static PeachVoiceVo init(UserInfo userInfo, PeachVoice peachVoice , Integer remainingTimes) {
        PeachVoiceVo vo = new PeachVoiceVo();
        BeanUtils.copyProperties(userInfo,vo);
        vo.setSoundUrl(peachVoice.getVoiceUrl());
        vo.setRemainingTimes(remainingTimes);
        return vo;
    }



}
